%% Main results (Table 2)
% FM regressions (Specification 1 & 2)
clear betas b t_stat
format short
for i = 1:size(call_deltahedge_returns_rb,1)
    % INSERT Y and X VARIABLES HERE %%%%%%%%%%%%%%%%%%%%%
    Y = call_deltahedge_returns_rb(i,:)'*100; 

    X = [Stock_PRisk(i,:)', Stock_PSentiment(i,:)', Stock_Betas_EPU(i,:)' ...
         log(Stock_CAP(i,:)'), Stock_BM(i,:)', Stock_IdioVol(i,:)', Stock_reversal(i,:)' ...
         Stock_Momentum(i,:)', Stock_illiquidity(i,:)', Stock_Inst(i,:)', Stock_Leverage(i,:)' ...
         Stock_GrossProfit(i,:)'];
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    stats = regstats(Y,[X]);    warning off 
    betas(i,:) = (stats.beta)';
    adjr2(i,1) = stats.adjrsquare;
end
clear stats Y X i

for i = 1:size(betas,2)
   nw_stats = nwest(betas(:,i),ones(size(betas(:,i))),4);
   b(i,1) = nw_stats.beta;
   t_stat(i,1) = nw_stats.tstat;
end
m_adjr2 = mean(adjr2);
clear nw_stats i adjr2 betas

%% FM regressions (Specification 3 & 4)
clear betas b t_stat
format short
for i = 1:size(call_deltahedge_returns_rb,1)
    % INSERT Y and X VARIABLES HERE %%%%%%%%%%%%%%%%%%%%%
    Y = put_deltahedge_returns_rb(i,:)'*100; 

    X = [Stock_PRisk(i,:)', Stock_PSentiment(i,:)', Stock_Betas_EPU(i,:)' ...
         log(Stock_CAP(i,:)'), Stock_BM(i,:)', Stock_IdioVol(i,:)', Stock_reversal(i,:)' ...
         Stock_Momentum(i,:)', Stock_illiquidity(i,:)', Stock_Inst(i,:)', Stock_Leverage(i,:)' ...
         Stock_GrossProfit(i,:)'];
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    stats = regstats(Y,[X]);    warning off 
    betas(i,:) = (stats.beta)';
    adjr2(i,1) = stats.adjrsquare;
end
clear stats Y X i

for i = 1:size(betas,2)
   nw_stats = nwest(betas(:,i),ones(size(betas(:,i))),4);
   b(i,1) = nw_stats.beta;
   t_stat(i,1) = nw_stats.tstat;
end
m_adjr2 = mean(adjr2);
clear nw_stats i adjr2 betas
